Step 1: Compute Camera Calibration


Step 2: Apply Distortion Correction

The effect of undistort is particularly noticeable, by the change in shape of the car hood at the bottom corners of the image.


Step 3: Apply a Perspective Transform


Step 4: Create a Thresholded Binary Image

Exploring different color spaces

RGB color space:

LAB color space:

The Lab color space describes mathematically all perceivable colors in the three dimensions L for lightness and a and b for the color opponents green–red and blue–yellow.

Color Space Thresholding

Sobel Differentiation

Comparison between Color Thresholding and Sobel Diffrentiation

As you can see, although Sobel diffrentiation was able to capture the lane lines correctly, it captured some noise around it. On the other hand, color thresholding was able to produce clean output highlighting the lane lines.


Step 5: Define the Image Processing Pipeline

Now, we'll define the complete image processing function to read the raw image and apply the following steps:

  1. Distortion Correction.
  2. Perspective Transform.
  3. Color Thresholding.

Step 6: Detect the Lane Lines

Polyfit Using Fit from Previous Frame

The Polyfit Using Fit from Previous Frame is another way that performs basically the same task, but alleviates much difficulty of the search process by leveraging a previous fit (from a previous video frame, for example) and only searching for lane pixels within a certain range of that fit.


Step 7: Determine the Curvature of the Lane and Vehicle Position


Step 8: Visual display of the Lane Boundaries and Numerical Estimation of Lane Curvature and Vehicle Position


Step 9: Process Project Videos

Processing the project video:

Processing the challenge video:

Processing the harder challenge video: